<template>
  <div class="property-company-register-success-page">
    <!-- 页面头部 -->
    <div class="page-header">
      <div class="header-content">
        <div class="logo-section">
          <el-icon class="logo-icon"><House /></el-icon>
          <h1 class="system-title">智慧社区管理系统</h1>
        </div>
      </div>
    </div>

    <!-- 成功内容 -->
    <div class="success-container">
      <el-card class="success-card" shadow="never">
        <div class="success-content">
          <!-- 成功图标 -->
          <div class="success-icon">
            <el-icon class="check-icon"><CircleCheckFilled /></el-icon>
          </div>

          <!-- 成功标题 -->
          <h2 class="success-title">注册申请提交成功</h2>

          <!-- 成功消息 -->
          <div class="success-message">
            <p>物业公司 <strong>{{ companyName }}</strong> 注册申请已提交，请等待平台方审核！</p>
          </div>

          <!-- 审核说明 -->
          <div class="audit-info">
            <h3>审核说明：</h3>
            <ul>
              <li>我们将在1-3个工作日内完成审核</li>
              <li>审核通过后，您将收到邮件和短信通知</li>
              <li>审核通过后，您可以使用注册的账号登录系统</li>
              <li>如有疑问，请联系客服：400-123-4567</li>
            </ul>
          </div>

          <!-- 操作按钮 -->
          <div class="action-buttons">
            <el-button type="primary" size="large" @click="goToLogin">
              <el-icon><User /></el-icon>
              返回登录界面
            </el-button>
            <el-button size="large" @click="goToRegister">
              <el-icon><Refresh /></el-icon>
              重新注册
            </el-button>
          </div>
        </div>
      </el-card>
    </div>

    <!-- 页面底部 -->
    <div class="page-footer">
      <p>&copy; 2024 智慧社区管理系统. All rights reserved.</p>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { House, CircleCheckFilled, User, Refresh } from '@element-plus/icons-vue'

// 路由相关
const router = useRouter()
const route = useRoute()

// 响应式数据
const companyName = ref('')

// 返回登录界面
const goToLogin = () => {
  router.push('/login')
}

// 重新注册
const goToRegister = () => {
  router.push('/property/company/register')
}

// 页面初始化
onMounted(() => {
  // 从路由参数获取公司名称
  const name = route.query.companyName as string
  if (name) {
    companyName.value = name
  } else {
    companyName.value = '您的公司'
  }
})
</script>

<style scoped>
.property-company-register-success-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* 背景动画 */
.property-company-register-success-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
  animation: float 20s ease-in-out infinite;
}

/* 页面头部 */
.page-header {
  padding: 40px 0 20px;
  text-align: center;
  color: white;
  z-index: 1;
  position: relative;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.logo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  gap: 12px;
}

.logo-icon {
  font-size: 32px;
  color: white;
}

.system-title {
  font-size: 28px;
  font-weight: bold;
  margin: 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* 成功容器 */
.success-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px 40px;
  z-index: 1;
  position: relative;
}

.success-card {
  width: 100%;
  max-width: 600px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.6s ease-out;
}

.success-content {
  padding: 60px 40px;
  text-align: center;
}

/* 成功图标 */
.success-icon {
  margin-bottom: 30px;
}

.check-icon {
  font-size: 80px;
  color: #67c23a;
  animation: bounceIn 0.8s ease-out;
}

/* 成功标题 */
.success-title {
  font-size: 32px;
  font-weight: bold;
  color: #333;
  margin: 0 0 20px 0;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* 成功消息 */
.success-message {
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.success-message p {
  font-size: 18px;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

.success-message strong {
  color: #409eff;
  font-weight: 600;
}

/* 审核说明 */
.audit-info {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 40px;
  text-align: left;
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

.audit-info h3 {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0 0 15px 0;
}

.audit-info ul {
  margin: 0;
  padding-left: 20px;
}

.audit-info li {
  font-size: 14px;
  color: #666;
  line-height: 1.8;
  margin-bottom: 8px;
}

.audit-info li:last-child {
  margin-bottom: 0;
}

/* 操作按钮 */
.action-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  animation: fadeInUp 0.8s ease-out 0.8s both;
}

.action-buttons .el-button {
  min-width: 160px;
  height: 48px;
  font-size: 16px;
  border-radius: 8px;
}

/* 页面底部 */
.page-footer {
  padding: 20px 0;
  text-align: center;
  color: white;
  z-index: 1;
  position: relative;
}

.page-footer p {
  margin: 0;
  font-size: 14px;
  opacity: 0.8;
}

/* 动画定义 */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .success-content {
    padding: 40px 20px;
  }
  
  .success-title {
    font-size: 24px;
  }
  
  .success-message p {
    font-size: 16px;
  }
  
  .action-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .action-buttons .el-button {
    width: 100%;
    max-width: 300px;
  }
}
</style>
